/*
 * @Author: Dorange.Wang
 * @Date: 2021-07-06 19:31:52
 * @LastEditors: your name
 * @LastEditTime: 2021-07-20 09:47:25
 * @Description: file content
 */
import Vue from "vue";
import VueRouter from "vue-router";
import { TabbarLayout } from "@/layouts";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "index",
    meta: { title: "首页" },
    redirect: "/workbench",
    component: TabbarLayout,
    children: [
      {
        path: "/workbench",
        name: "workbench",
        meta: { title: "工作台" },
        component: () =>
          import(/* webpackChunkName: "tabbar" */ "@/views/workbench/Workbench"),
      },
      {
        path: "/user-center",
        name: "userCenter",
        meta: { title: "我的" },
        component: () =>
          import(
            /* webpackChunkName: "tabbar" */ "@/views/userCenter/UserCenter"),
      },
    ],
  },
  {
    path: "/universal/:pageId",
    name: "universal",
    meta: { title: "动态页面" },
    component: () =>
      import(/* webpackChunkName: "universal" */ "@/views/universal/Universal"),
  },
  {
    path: "/user/login",
    name: "userLogin",
    meta: { title: "登录" },
    component: () =>
      import(/* webpackChunkName: "user" */ "@/views/user/Login.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
